<template>
  <div class="wrap">
    <div class="search">
      <g-search></g-search>
    </div>
    <ul class="fisrtCate">
      <li
        @click="$router.push('/list?id='+item.id)+'&type=1'"
        v-for="item in firstCates"
        :key="item.id"
      >{{item.catename}}</li>
    </ul>

    <div>
      <go-lunbo></go-lunbo>
      <v-list></v-list>
      <!-- <div class="footer">
        <router-link to="/index/home">首页</router-link>
        <router-link to="/index/cate">首页</router-link>
        <router-link to="/index/shopCar">首页</router-link>
        <router-link to="/index/mine">首页</router-link>
      </div>-->
    </div>
  </div>
</template>

<script>
import { reqFirstCate } from "../../http/api";
import vList from "./components/list.vue";
export default {
  components: {
    vList,
  },
  data() {
    return {
      firstCates: [],
    };
  },
  mounted() {
    reqFirstCate().then((res) => {
      this.firstCates = res.data.list.slice(0, 5);
    });
  },
};
</script>

<style scoped>
.fisrtCate {
  display: flex;
  background: tomato;
}
.fisrtCate li {
  flex: 1;
  font-size: 0.3rem;
  text-align: center;
  height: 0.6rem;
  line-height: 0.6rem;
}
.search {
  height: 1.2rem;
  background: tomato;
}
</style>